package org.yang.order.food.controller;

import org.yang.order.food.common.Msg;
import org.yang.order.food.entity.OrderInfo;
import org.yang.order.food.service.OrderInfoService;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;

import javax.annotation.Resource;
/**
 * 订单详细控制器
 * @author shichenyang
 * @email gyv12345@163.com
 * @date 2018/12/03
 */
@RestController
@RequestMapping("/orderInfo")
public class OrderInfoController {
    @Resource
    private OrderInfoService orderInfoService;

    @GetMapping("/getOrderInfos")
    public PageInfo getOrderInfos(OrderInfo orderInfo,Integer page,Integer limit){
        return orderInfoService.getOrderInfos(orderInfo,page,limit);
    }
    @PostMapping("/addOrderInfo")
    public Msg addOrderInfo(OrderInfo orderInfo){
        return orderInfoService.addOrderInfo(orderInfo);
    }

    @PutMapping("/updateOrderInfo")
    public Msg updateOrderInfo(OrderInfo orderInfo){
        return orderInfoService.updateOrderInfo(orderInfo);
    }

    @DeleteMapping("/delOrderInfo")
    public Msg delOrderInfo(OrderInfo orderInfo){
        return orderInfoService.delOrderInfo(orderInfo);
    }
}
